package com.ruoyi.project.api.controller;

import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.project.anquan.domain.SecuritySgsj;
import com.ruoyi.project.api.service.ApiISecuritySgsjService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.page.TableDataInfo;

/**
 * 事故事件Controller
 * 
 * @author ruoyi
 * @date 2020-05-11
 */
@RestController
@RequestMapping("/api/anquan/sgsj")
@CrossOrigin //所有域名均可访问该类下所有接口
//@CrossOrigin("https://blog.csdn.net") // 只有指定域名可以访问该类下所有接口
public class ApiSecuritySgsjSgController extends BaseController
{
    @Autowired
    private ApiISecuritySgsjService apiSecuritySgsjService;

    /**
     * 按事件类型统计统计
     */
    @GetMapping("/sg")
    public TableDataInfo statisticsByEventType()
    {
        startPage();
        List<SecuritySgsj> list = apiSecuritySgsjService.statisticsByEventType();
        return getDataTable(list);
    }
}
